const express = require('express')

const app = express()

// 配置解析表单json格式数据的中间件express.json()
app.use(express.json())
// 配置解析表单urlencoded格式数据的中间件express.urlencoded()
app.use(express.urlencoded({extended:false}))


app.post('/', (req, res) => {
  /* 
  req.body获取客户端传过来的请求体数据
  
  json数据需要配置express.json()
  urlencoded数据配置express.urlencoded()
  */
  console.log(req.body);
  res.send('Home Page')
})

app.listen(80, () => {
  console.log('express server created  running at http://127.0.0.1');
})